<template>
  <el-form
    label-width="130px">
    <el-row class="form-row">
      <el-col :span="4">
        <label class="form-label">规划名称</label>
      </el-col>
      <el-col :span="18" >
        <p>{{registerInfo.title}}</p>
      </el-col>
    </el-row>
    <el-row class="form-row">
      <el-col :span="4">
        <label class="form-label">规划类型</label>
      </el-col>
      <el-col :span="8" >
        <p>{{getDicLabel(categoryDic,registerInfo.category)}}</p>
      </el-col>
      <el-col :span="4">
        <label class="form-label">规划期限</label>
      </el-col>
      <el-col :span="8">
        <p>
          <span>{{registerInfo.startDate}}</span>
          <span style="margin-left: 5px;margin-right: 5px">至</span>
          <span>{{registerInfo.endDate}}</span>
        </p>
      </el-col>
    </el-row>
    <el-row class="form-row">
      <el-col :span="4">
        <label class="form-label">申报(牵头)单位</label>
      </el-col>
      <el-col :span="8" >
        <p>{{registerInfo.orgName}}</p>
      </el-col>
    </el-row>
    <el-row v-if="registerInfo.supportDeptName">
      <el-col :span="4">
        <label class="form-label">协同编制部门</label>
      </el-col>
      <el-col :span="20" >
        {{registerInfo.supportDeptName}}
      </el-col>
    </el-row>
    <el-row class="form-row">
      <el-col :span="4">
        <label class="form-label">拟发布层级</label>
      </el-col>
      <el-col :span="8" >
        <p>{{getDicLabel(planningLevelDic,registerInfo.planningLevel)}}</p>
      </el-col>
      <el-col :span="4">
        <label class="form-label">拟发布时间</label>
      </el-col>
      <el-col :span="8">
        <p>{{registerInfo.releaseDate}}</p>
      </el-col>
    </el-row>
    <el-row class="form-row">
      <el-col :span="4">
        <label class="form-label">审批机关级别</label>
      </el-col>
      <el-col :span="8" >
        <p>{{getDicLabel(authorityLevelDic,registerInfo.approvingAuthorityLevel)}}</p>
      </el-col>
      <el-col :span="4">
        <label class="form-label">审批机关性质</label>
      </el-col>
      <el-col :span="8">
        <p>{{getDicLabel(natureDIC,registerInfo.approvingAuthorityNature)}}</p>
      </el-col>
    </el-row>
    <el-row class="form-row">
      <el-col :span="4">
        <label class="form-label">联系人</label>
      </el-col>
      <el-col :span="8" >
        <p>{{registerInfo.contactName}}</p>
      </el-col>
      <el-col :span="4">
        <label class="form-label">联系电话</label>
      </el-col>
      <el-col :span="8">
        <p>{{registerInfo.contactNumber}}</p>
      </el-col>
    </el-row>
    <el-row class="form-row">
      <el-col :span="4">
        <label class="form-label">经费来源</label>
      </el-col>
      <el-col :span="20" >
        <p>{{registerInfo.financialSource}}</p>
      </el-col>
    </el-row>
    <el-row class="form-row">
      <el-col :span="4">
        <label class="form-label">立项依据</label>
      </el-col>
      <el-col :span="20" v-html="registerInfo.basis">
      </el-col>
    </el-row>
    <el-row class="form-row">
      <el-col :span="4">
        <label class="form-label">立项依据材料</label>
      </el-col>
      <el-col :span="8" v-for="(file,index) in basisFileList" :key="index">
        <file-download :file-id="file.url" :file-name="file.name"></file-download>
      </el-col>
    </el-row>
    <el-row class="form-row">
      <el-col :span="4">
        <label class="form-label">主要内容</label>
      </el-col>
      <el-col :span="20" v-html="registerInfo.content">
      </el-col>
    </el-row>
    <el-row class="form-row">
      <el-col :span="4">
        <label class="form-label">相关材料</label>
      </el-col>
      <el-col :span="8" v-for="(file,index) in fileList" :key="index">
        <file-download :file-id="file.url" :file-name="file.name"></file-download>
      </el-col>
    </el-row>
  </el-form>
</template>

<script>
  import {PROJECT_DIC} from "@/const/dict";
  import fileDownload from "@/components/file/download.vue"
  /**
   * 立项申请的提交确认页面
   */
  export default {
    name: "submitConfirm",
    components:{
      fileDownload
    },
    data:function () {
      return {
        categoryDic:PROJECT_DIC.CATEGORY,
        orgCodeDic: PROJECT_DIC.ORG_CODE,
        planningLevelDic: PROJECT_DIC.PLANNING_LEVEL,
        authorityLevelDic: PROJECT_DIC.APPROVING_AUTHORITY_LEVEL,
        natureDIC: PROJECT_DIC.APPROVING_AUTHORITY_NATURE,
      }
    },
    props:{
      registerInfo:Object,
      basisFileList:Array,
      fileList:Array
    },
    methods:{
      getDicLabel(dicList,dicValue) {
        for (let dic of dicList) {
          if(dic.value == dicValue){
            return dic.label;
          }
        }
      }
    }
  }
</script>

<style scoped>
  .form-item{
    font-weight: 600;
  }
  .form-label{
    text-align: right;
    vertical-align: middle;
    float: left;
    font-size: 16px;
    color: #606266;
    line-height: 40px;
    box-sizing: border-box;
  }
  .form-row{
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd
  }
</style>
